package com.hotel.controller;


import com.hotel.common.lang.Result;
import com.hotel.entity.User;
import com.hotel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 关注公众号：MarkerHub
 * @since 2020-10-19
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    public UserService userService;

    //是否需要登录才能访问
//    @RequiresAuthentication

    @ResponseBody
    @RequestMapping("/test")
    public Object test(){
        User user = userService.getById(1L);
        return Result.succ(user);
    }
}
